// ChatClientView.cpp : implementation file
//

#include "stdafx.h"
#include "Chat.h"
#include "ChatClientView.h"
#include "ChatClientLobbyDlg.h"
#include "ChildFrm.h"

// CChatClientView

IMPLEMENT_DYNCREATE(CChatClientView, CView)

CChatClientView::CChatClientView()
: m_pActivateClientDlg(NULL)
{

}

CChatClientView::~CChatClientView()
{
	if (m_pActivateClientDlg)
	{
		delete m_pActivateClientDlg;
		m_pActivateClientDlg = NULL;
	}
}

BEGIN_MESSAGE_MAP(CChatClientView, CView)	

END_MESSAGE_MAP()


// CChatClientView drawing

void CChatClientView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}


// CChatClientView diagnostics

#ifdef _DEBUG
void CChatClientView::AssertValid() const
{
	CView::AssertValid();
}

#ifndef _WIN32_WCE
void CChatClientView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif
#endif //_DEBUG


// CChatClientView message handlers

void CChatClientView::OnInitialUpdate()
{
	CView::OnInitialUpdate();

	// TODO: Add your specialized code here and/or call the base class
	m_pActivateClientDlg = new CChatClientLobbyDlg;
	m_pActivateClientDlg->SetChatClientDoc(reinterpret_cast<CChatClientDoc&>(*GetDocument()));
	m_pActivateClientDlg->SetLogView(*reinterpret_cast<CChildFrame*>(GetParentFrame())->GetLogView());

	m_pActivateClientDlg->Create(CChatClientLobbyDlg::IDD, this);
	
}

void CChatClientView::SetActivateClientDlg( CChatClientBaseDlg* pClientDlg )
{
	m_pActivateClientDlg = pClientDlg;
}